package com.itedge.solutionmanager.service.task.impl.solution;

import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itedge.solutionmanager.domain.impl.Solution;
import com.itedge.infrastructure.service.task.ITaskService;
import com.itedge.infrastructure.service.taskdata.ITaskDataEntityService;
import com.itedge.solutionmanager.taskdata.impl.solution.AddDocumentationTaskData;

@Service
public class AddDocumentationTaskService implements ITaskService<AddDocumentationTaskData, Solution> {

    @Autowired
    protected TaskService taskService;
    @Autowired
    private ITaskDataEntityService<AddDocumentationTaskData> addDocumentationTaskDataService;
	
	@Override
	@Transactional
	public void completeTask(String taskId, Solution linkedObject,
			AddDocumentationTaskData taskData, String user) {
    	addDocumentationTaskDataService.merge(taskData);
    	taskService.setAssignee(taskId, user);
    	taskService.complete(taskId);		
	}

}
